\documentclass{ctexart}
\usepackage{listings}%插入代码
\usepackage{geometry}%设置页面大小边距等
\usepackage{authblk}%作者机构等信息
\usepackage{graphicx}%插入图片
\usepackage{url}%Bib中引用网页
\usepackage{amssymb}%为了用\mathbb
\usepackage{amsmath}%数学方程的显示
%\usepackage{amsthm}%数学定理
\usepackage{listings}%插入代码
\usepackage{fancyhdr}%设置页眉页脚
\usepackage{lastpage}%总页数
\usepackage{hyperref}%引用网页
\usepackage{xcolor}
\usepackage{tikz}



\geometry{a4paper,left=2cm,right=2cm,top=2cm,bottom=2cm}%一定要放在前面！
\pagestyle{fancy}%设置页眉页脚
\lhead{陈冠宇\ 3200102033}%页眉左
\chead{Numerical Analysis}%页眉中
\rhead{HW1}%章节信息
\cfoot{\thepage/\pageref{LastPage}}%当前页，记得调用前文提到的宏包
\rfoot{浙江大学数学科学学院}
\renewcommand{\headrulewidth}{0.1mm}%页眉线宽，设为0可以去页眉线
\renewcommand{\footrulewidth}{0.1mm}%页脚线宽，设为0可以去页眉线
\setlength{\headwidth}{\textwidth}

\hypersetup{%设置网页链接颜色等
    colorlinks=true,%链接将会有颜色，默认是红色
    linkcolor=blue,%内部链接，那些由交叉引用生成的链接将会变为蓝色（blue）
    filecolor=magenta,%链接到本地文件的链接将会变为洋红色（magenta）
    urlcolor=blue,%链接到网站的链接将会变为蓝绿色（cyan）
    }

\newtheorem{theorem}{Theorem}
\newtheorem{proof}{Proof}
\newtheorem{solution}{Solution:}

\title{\textbf{数值分析第一次作业}}
\author[1]{陈冠宇\ 3200102033}
%\affil[1]{数学与应用数学\ 强基计划2001\ 浙江大学数学科学学院}
\date{\today}

\begin{document}
%\maketitle
%\newpage
\section*{1.8.1 Theoretical questions}
\subsection*{\uppercase\expandafter{\romannumeral1}}
\begin{solution}
 The width of the interval at $n$th step is
 $\frac{1}{2^{n-1}}$.
\end{solution}

\begin{solution}
  The supremum of the distance is 0.
\end{solution}

\subsection*{\uppercase\expandafter{\romannumeral2}}
\begin{proof}
  .  Let $x_0$ be the root of f(x),then let $\frac{b_0-a_0}{2^n}/x_0<\frac{b_0-a_0}{2^n}/a_0<\epsilon$

  Then we have $$n>\log_2\frac{b_0-a_0}{\epsilon a_0}$$
  That is $$n\geq \frac{log{(b_0-a_0)}-\log\epsilon-\log a_0}{\log 2}-1$$
\end{proof}
\subsection*{\uppercase\expandafter{\romannumeral3}}
\begin{solution}
  For the polynomial equation $p(x)=4x^3-2x^2+3$ with the starting point $x_0=-1$, we have $p(-1)=-3,p'(x)=12x^2-4x$.

  Since $x_{n+1}=x_n-\frac{f(x_n)}{f'(x_n)}$, then we have
  \begin{equation}
      \begin{array}{cccc}
    . & x & f(x) & f'(x) \\
    0 & -1 & -3 & 16 \\
    1 & -0.8125 & -0.4658 & 11.1719 \\
    2 & -0.7708 & -0.0201 & 10.2128 \\
    3 & -0.7688 & 0.0003  & 10.1678 \\
    4 & -0.76883 & -1.95E-5 & 10.1685 \\
    Result & -0.768828 & .  &  .
  \end{array}
  \nonumber
  \end{equation}
\end{solution}
\subsection*{\uppercase\expandafter{\romannumeral4}}
\begin{proof}
Since we have $$x_{n+1}=x_n-\frac{f(x_n)}{f'(x_0)}$$
and $$f(x)=f(x_n)+f'(x_n)(x-x_n)+O(x-x_n)$$
Then we have
\begin{equation}
  \begin{aligned}
    e_{n+1}&=f(x_{n+1})=f(x_n)+f'(x_n)(x_{n+1}-x_n)+O(x-x_n)\\
    &=f(x_n)+f'(x_n)\left(-\frac{f(x_n)}{f'(x_0)}\right)+O\\
    &=\left(1-\frac{f'(x_n)}{f'(x_0)}\right)f(x_n)+O\\
    &=\left(1-\frac{f'(x_n)}{f'(x_0)}\right)e_n
\end{aligned}
\nonumber
\end{equation}

That is $$C=1-\frac{f'(x_n)}{f'(x_0)},s=1$$
\end{proof}
\subsection*{\uppercase\expandafter{\romannumeral5}}
\begin{solution}
  The iteration will converge to 0 within $[-\frac{\pi}{2},\frac{\pi}{2}]$.

  Since $y=arctan(x)<x,x>0$,$x_{n+1}<x_n$,then${x_n}$ is a monotonic sequence. By Monotonic sequence theorem, $x_n\in [0,\frac{\pi}{2}]$,then ${x_n}$ converges.

  Then we prove ${x_n}$converges to 0.

  Assume ${x_n}$ monotonic converges to C, while $C>0$. That is, $\forall \epsilon >0,\exists N, s.t. \forall n>N,0<x_n-C<\epsilon$.

  Since we have then $x_n=arctan C<C$,contradiction.Then C=0.

  Similarly,$-\frac{\pi}{2}<x<0$.
\end{solution}
\subsection*{\uppercase\expandafter{\romannumeral6}}
\begin{solution}
  $x=\frac{-p+\sqrt{p^2+4}}{2}$

  Let $x_n=\frac{1}{p+\frac{1}{p+...}}$,that is $x_1=\frac{1}{p},x_2=\frac{1}{p+\frac{1}{p+1}},...$,then we have $x_n>0$.

  Since $\frac{1}{p}>\frac{1}{\frac{1}{p}}$,then$x_1>x_2>...>x_n$.Then ${x_n}$ is monotonic and bounded. Then by Monotonic sequence theorem, $\exists x=\lim_{n\rightarrow \infty}x_n$.

  Then $x=\frac{1}{p+x}$, we have $x=\frac{-p+\sqrt{p^2+4}}{2}$.
\end{solution}
\subsection*{\uppercase\expandafter{\romannumeral7}}
\begin{solution}
  When $a_0<0$, then $\log a_0$ doesn't hold.

  $$n\geq \frac{log{(b_0-a_0)}-\log\epsilon}{\log 2}-1.$$ The relative error is not an appropriate measure cause the root may be close to 0, that is, the root is close to $\epsilon$.
\end{solution}


\bibliographystyle{plain}
\bibliography{reference}
\end{document} 